package com.social.controller;

import com.social.pojo.Result;
import com.social.pojo.SysUser;
import com.social.service.SysUserService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import javax.validation.Valid;

/**
 * @BelongsProject: social
 * @BelongsPackage: com.social.controller
 * @Author: zhm
 * @CreateTime: 2022-12-11  18:59
 * @Description: TODO
 * @Version: 1.0
 */
@Api("Login")
@RestController
@RequestMapping("")
public class LoginController {

    @Resource
    private SysUserService userService;

    @PostMapping("/Login")
    public Result login(@Valid @RequestBody SysUser sysUser, HttpSession session) {
        return userService.login(sysUser, session);
    }

    @GetMapping("/getKey")
    public Result getKey() {
        return userService.getKey();
    }
}
